function Trig_PauseNoSupplyBuilding_Actions takes nothing returns nothing
	local unit building = GetTriggerUnit()
	local integer buildingId = GetHandleId(building)
	local integer buildingTypeId = GetUnitTypeId(building)
	local integer supplyNeededRemain = LoadInteger(udg_UnitTypeDataHashTable , buildingTypeId , StringHash("SUPPLY_NEEDED")) - LoadInteger(udg_UnitDataHashTable , buildingId , StringHash("SUPPLY_NOW"))
	//--
	if supplyNeededRemain > 0 then
		call PauseUnit(building , true)
	endif
	if buildingTypeId == 'h009' then //基底工廠
		call ReplaceUnitSimple(building , 'h009')
		call UnitRemoveAbility(GetLastReplacedUnitBJ() , 'ARal')
	endif
endfunction

function InitTrig_PauseNoSupplyBuilding takes nothing returns nothing
	set gg_trg_PauseNoSupplyBuilding = CreateTrigger()
	call TriggerRegisterPlayerForceUnitEvent(gg_trg_PauseNoSupplyBuilding , EVENT_PLAYER_UNIT_CONSTRUCT_FINISH)
	call TriggerAddAction(gg_trg_PauseNoSupplyBuilding , function Trig_PauseNoSupplyBuilding_Actions)
endfunction